//
//  MySaveModel.m
//  有材网
//
//  Created by 肖扬 on 16/1/20.
//  Copyright © 2016年 肖扬. All rights reserved.
//

#import "MySaveModel.h"
#import "GoodsModel.h"
@implementation MySaveModel
@synthesize list,data;
-(id)init{
    self = [super init];
    if (self) {
        self.data = [NSMutableDictionary dictionary];
        self.list = [NSMutableArray array];
    }
    return self;
}
-(void)parseResponseData:(NSString *)responseString{
    [super parseResponseData:responseString];
    NSMutableDictionary *jsonData = [responseString objectFromJSONString];
    NSMutableDictionary *data1 = [jsonData objectForKey:@"data"];
    NSMutableArray *listData = [data1 objectForKey:@"list"];
    NSMutableDictionary *pageData = [data1 objectForKey:@"pages"];
    if (pageData!=nil) {
        ModelPage *model = [[ModelPage alloc]init];
        model.total_num = [pageData objectForKey:@"total_page"];
        model.total_num = [pageData objectForKey:@"current_page"];
        model.total_num = [pageData objectForKey:@"page_size"];
        model.total_num = [pageData objectForKey:@"total_num"];
        [self.data setObject:model forKey:@"pages"];
    }
    if ([listData count]!=0) {
        for (int i = 0; i < [listData count]; i++) {
            NSMutableDictionary *dic = [listData objectAtIndex:i];
            homeModelSupply *homeSupply = [[homeModelSupply alloc]init];
            homeSupply.pics = [dic objectForKey:@"pics"];
            homeSupply.home_id = [dic objectForKey:@"id"];
            homeSupply.mid = [dic objectForKey:@"mid"];
            homeSupply.material_id = [dic objectForKey:@"material_id"];
            homeSupply.brand_id = [dic objectForKey:@"brand_id"];
            
            homeSupply.image_url = [dic objectForKey:@"image_url"];
            
            homeSupply.brand_other = [dic objectForKey:@"brand_other"];
            homeSupply.producer_id = [dic objectForKey:@"producer_id"];
            homeSupply.future = [dic objectForKey:@"future"];
            homeSupply.model = [dic objectForKey:@"model"];
            homeSupply.eplevel = [dic objectForKey:@"eplevel"];
            
            homeSupply.texture = [dic objectForKey:@"texture"];
            homeSupply.unit_number = [dic objectForKey:@"unit_number"];
            homeSupply.stuff = [dic objectForKey:@"stuff"];
            homeSupply.veneer = [dic objectForKey:@"veneer"];
            homeSupply.gram = [dic objectForKey:@"gram"];
            homeSupply.length = [dic objectForKey:@"length"];
            
            homeSupply.width = [dic objectForKey:@"width"];
            homeSupply.thickness = [dic objectForKey:@"thickness"];
            homeSupply.number = [dic objectForKey:@"number"];
            homeSupply.min_buy_number = [dic objectForKey:@"min_buy_number"];
            homeSupply.price = [dic objectForKey:@"price"];
            
            homeSupply.province = [dic objectForKey:@"province"];
            homeSupply.city = [dic objectForKey:@"city"];
            homeSupply.remark = [dic objectForKey:@"remark"];
            homeSupply.is_sales = [dic objectForKey:@"is_sales"];
            homeSupply.producer_name = [dic objectForKey:@"producer_name"];
            
            homeSupply.material_name = [dic objectForKey:@"material_name"];
            homeSupply.brand_name = [dic objectForKey:@"brand_name"];
            homeSupply.province_name = [dic objectForKey:@"province_name"];
            homeSupply.city_name = [dic objectForKey:@"city_name"];
            homeSupply.pubtime_int = [dic objectForKey:@"pubtime_int"];
            homeSupply.unit = [dic objectForKey:@"unit"];
            homeSupply.price2 = [dic objectForKey:@"price2"];
            homeSupply.surface = [dic objectForKey:@"surface"];
            homeSupply.title = [dic objectForKey:@"title"];
            
            
            homeSupply.no = [dic objectForKey:@"no"];
            homeSupply.supplier_mid = [dic objectForKey:@"supplier_mid"];
            homeSupply.purchaser_mid = [dic objectForKey:@"purchaser_mid"];
            homeSupply.amount = [dic objectForKey:@"amount"];
            homeSupply.post_address = [dic objectForKey:@"post_address"];
            homeSupply.freight = [dic objectForKey:@"freight"];
            homeSupply.payment_type = [dic objectForKey:@"payment_type"];
            homeSupply.payment_id = [dic objectForKey:@"payment_id"];
            homeSupply.supply_id = [dic objectForKey:@"supply_id"];
            
            homeSupply.purchase_id = [dic objectForKey:@"purchase_id"];
            homeSupply.creator = [dic objectForKey:@"creator"];
            homeSupply.mender = [dic objectForKey:@"mender"];
            homeSupply.nickname = [dic objectForKey:@"nickname"];
            homeSupply.company_name = [dic objectForKey:@"company_name"];
            homeSupply.ctime_int = [dic objectForKey:@"ctime_int"];
            
            homeSupply.audit_status = [dic objectForKey:@"audit_status"];
            homeSupply.audit_manager = [dic objectForKey:@"audit_manager"];
            [self.list addObject:homeSupply];
        }
    }

    
//    if ([listData count]!=0) {
//        for (int i = 0; i < [listData count]; i++) {
//            NSMutableDictionary *dic = [listData objectAtIndex:i];
//            SaveModel *model = [[SaveModel alloc]init];
//            model.save_id = [dic objectForKey:@"id"];
//            model.mid = [dic objectForKey:@"mid"];
//            model.material_id = [dic objectForKey:@"material_id"];
//            model.brand_id = [dic objectForKey:@"brand_id"];
//            model.brand_other = [dic objectForKey:@"brand_other"];
//            
//            model.producer_id = [dic objectForKey:@"producer_id"];
//            model.future = [dic objectForKey:@"future"];
//            model.veneer = [dic objectForKey:@"veneer"];
//            model.model = [dic objectForKey:@"model"];
//            model.eplevel = [dic objectForKey:@"eplevel"];
//            
//            model.texture = [dic objectForKey:@"texture"];
//            model.surface = [dic objectForKey:@"surface"];
//            model.unit_number = [dic objectForKey:@"unit_number"];
//            model.length = [dic objectForKey:@"length"];
//            model.width = [dic objectForKey:@"width"];
//            
//            model.thickness = [dic objectForKey:@"thickness"];
//            model.number = [dic objectForKey:@"number"];
//            model.min_buy_number = [dic objectForKey:@"min_buy_number"];
//            model.price = [dic objectForKey:@"price"];
//            model.price2 = [dic objectForKey:@"price2"];
//            
//            model.title = [dic objectForKey:@"title"];
//            model.province = [dic objectForKey:@"province"];
//            model.city = [dic objectForKey:@"city"];
//            model.image_url = [dic objectForKey:@"image_url"];
//            model.remark = [dic objectForKey:@"remark"];
//            
//            model.upload_log_id = [dic objectForKey:@"upload_log_id"];
//            model.is_sales = [dic objectForKey:@"is_sales"];
//            model.create_manager = [dic objectForKey:@"create_manager"];
//            model.audit_status = [dic objectForKey:@"audit_status"];
//            model.audit_manager = [dic objectForKey:@"audit_manager"];
//
//            model.audit_comment = [dic objectForKey:@"audit_comment"];
//            model.status = [dic objectForKey:@"status"];
//            model.mtime = [dic objectForKey:@"mtime"];
//            model.pubtime = [dic objectForKey:@"pubtime"];
//            model.ctime = [dic objectForKey:@"ctime"];
//            
//            model.producer_name = [dic objectForKey:@"producer_name"];
//            model.material_name = [dic objectForKey:@"material_name"];
//            model.brand_name = [dic objectForKey:@"brand_name"];
//            model.pics = [dic objectForKey:@"pics"];
//            model.province_name = [dic objectForKey:@"province_name"];
//            
//            model.city_name = [dic objectForKey:@"city_name"];
//            [self.list addObject:model];
//        }
//    }
}
@end

@implementation SaveModel

@synthesize save_id,mid,material_id,brand_id,brand_other,producer_id,future,veneer,model;
@synthesize eplevel,texture,surface,unit_number,length,width,thickness,number,min_buy_number;
@synthesize price,price2,title,province,city,image_url,remark,upload_log_id,is_sales,create_manager;
@synthesize audit_status,audit_manager,audit_comment,status,mtime,pubtime,ctime,producer_name,material_name;
@synthesize brand_name,pics,province_name,city_name;
-(id)init{
    self = [super init];
    if (self) {
        self.pics = [NSMutableDictionary dictionary];
    }
    return self;
}
@end
